// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 获得验证码接口 POST /api/user/getCaptcha */
export async function getCaptcha(options?: { [key: string]: any }){
  return request<string>('/api/user/captcha', {
    method: 'GET',
    ...(options || {}),
  });
}

/** getLoginUser GET /api/user/info */
export async function getLoginUserUsingGet(options?: { [key: string]: any }) {
  return request<API.LoginUserVO>('/api/user/info', {
    method: 'GET',
    ...(options || {}),
  });
}

/** userLogin POST /api/user/login */
export async function userLoginUsingPost(
  body: API.UserLoginRequest,
  options?: { [key: string]: any },
) {
  return request<API.LoginUserVO>('/api/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** userLogout GET /api/user/outLogin */
export async function userLogoutUsingPost(options?: { [key: string]: any }) {
  return request<boolean>('/api/user/outLogin', {
    method: 'GET',
    ...(options || {}),
  });
}

/** userRegister POST /api/user/register */
export async function userRegisterUsingPost(
  body: Admin.RegisterParams,
  options?: { [key: string]: any },
) {
  return request<boolean>('/api/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** updateUser POST /api/user/update */
export async function updateUserUsingPost(
  body: API.UserUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/user/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** updateMyUser POST /api/user/update/my */
export async function updateMyUserUsingPost(
  body: API.UserUpdateMyRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/user/update/my', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

